package list集合;

import java.util.ArrayList;
import java.util.List;

public class list {

    /*
    * list
    *  1.有序
    *  2.有索引
    *  3.允许重复
    * */
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        //add
        list.add("a");
        list.add("c");
        list.add("a");
        list.add("b");

        list.add(3,"eer");

        System.out.println(list);//[a, c, a, b]
        String s = list.get(2);
        System.out.println(s);

        list.set(2,"qqq");
        System.out.println(list);
    }
}
